using System;
using System.Collections.Generic;

namespace Acme.BookStore.Redis
{
    /// <summary>
    /// Redis状态信息DTO
    /// </summary>
    public class RedisStatusDto
    {
        /// <summary>
        /// Redis是否启用
        /// </summary>
        public bool IsEnabled { get; set; }
        
        /// <summary>
        /// Redis连接配置
        /// </summary>
        public string Configuration { get; set; }
        
        /// <summary>
        /// Redis实例名称
        /// </summary>
        public string InstanceName { get; set; }
        
        /// <summary>
        /// Redis状态
        /// </summary>
        public string Status { get; set; }
        
        /// <summary>
        /// 消息
        /// </summary>
        public string Message { get; set; }
        
        /// <summary>
        /// 已使用内存
        /// </summary>
        public string UsedMemory { get; set; }
        
        /// <summary>
        /// 最大内存
        /// </summary>
        public string MaxMemory { get; set; }
        
        /// <summary>
        /// 连接的客户端数量
        /// </summary>
        public string ConnectedClients { get; set; }
        
        /// <summary>
        /// 总命令数
        /// </summary>
        public string TotalCommands { get; set; }
        
        /// <summary>
        /// 缓存命中率
        /// </summary>
        public string CacheHitRate { get; set; }
        
        /// <summary>
        /// 总键数
        /// </summary>
        public int TotalKeys { get; set; }
        
        /// <summary>
        /// BookStore相关键数
        /// </summary>
        public int BookStoreKeys { get; set; }
        
        /// <summary>
        /// 客户列表相关键数
        /// </summary>
        public int KehuListKeys { get; set; }
        
        /// <summary>
        /// 客户搜索相关键数
        /// </summary>
        public int KehuSearchKeys { get; set; }
        
        /// <summary>
        /// 客户高级搜索相关键数
        /// </summary>
        public int KehuAdvSearchKeys { get; set; }
        
        /// <summary>
        /// 响应延迟
        /// </summary>
        public string Latency { get; set; }
        
        /// <summary>
        /// 运行时间(秒)
        /// </summary>
        public string UptimeInSeconds { get; set; }
        
        /// <summary>
        /// 运行时间(天)
        /// </summary>
        public string UptimeInDays { get; set; }
        
        /// <summary>
        /// 内存碎片率
        /// </summary>
        public string MemoryFragmentationRatio { get; set; }
        
        /// <summary>
        /// 过期键数量
        /// </summary>
        public string ExpiredKeysCount { get; set; }
        
        /// <summary>
        /// 驱逐键数量
        /// </summary>
        public string EvictedKeysCount { get; set; }
        
        /// <summary>
        /// 缓存命中次数
        /// </summary>
        public string KeyspaceHits { get; set; }
        
        /// <summary>
        /// 缓存未命中次数
        /// </summary>
        public string KeyspaceMisses { get; set; }
        
        /// <summary>
        /// 拒绝的连接数
        /// </summary>
        public string RejectedConnections { get; set; }
    }
    
    /// <summary>
    /// Redis性能指标
    /// </summary>
    public class RedisPerformanceMetrics
    {
        /// <summary>
        /// Redis是否启用
        /// </summary>
        public bool IsEnabled { get; set; }
        
        /// <summary>
        /// 消息
        /// </summary>
        public string Message { get; set; }
        
        /// <summary>
        /// 基准测试结果
        /// </summary>
        public Dictionary<string, string> BenchmarkResults { get; set; }
        
        /// <summary>
        /// 内存使用情况
        /// </summary>
        public Dictionary<string, string> MemoryStats { get; set; }
        
        /// <summary>
        /// 命令统计
        /// </summary>
        public Dictionary<string, long> CommandStats { get; set; }

        /// <summary>
        /// SET操作每秒处理量
        /// </summary>
        public long SetOperationsPerSecond { get; set; }
        
        /// <summary>
        /// GET操作每秒处理量
        /// </summary>
        public long GetOperationsPerSecond { get; set; }
        
        public RedisPerformanceMetrics()
        {
            BenchmarkResults = new Dictionary<string, string>();
            MemoryStats = new Dictionary<string, string>();
            CommandStats = new Dictionary<string, long>();
        }
    }
} 